package com.common.base.data

import java.io.Serializable

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2022/8/19
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
open class Common<T> {
    @Transient
    open var Data: T? = null
    val Message: String? = null
    var Code: Int = 0
    val systemTime: Long = 0
    var hasMore = false

    fun isSuccess(): Boolean {
        return Code == 0
    }
}

open class CommonBean<T> : Common<T>() {
    override var Data: T? = null
}

open class ListCommon<T> : Common<List<T>>() {
    init {
        Code = 200
    }

    override var Data: List<T>? = null
}

class DataPage<T> : Serializable {
    var list: MutableList<T>? = null
    var page: Int = 1
    var pages: Int = 1
    var size: Int = 10
    var total: Int = 0
    var currentPage: Int = 0//本地使用
}

class DataPage2<T> : Serializable {
    var records: List<T>? = null
    var current: Int = 1
    var pages: Int = 1
    var size: Int = 10
    var total: Int = 0
}